using System;
using EPiServer.Common;
using EPiServer.Common.Queries;
using EPiServer.Common.Reporting;
using EPiServer.Common.Security;

namespace EPiAbstractions.Common.Reporting
{
    public interface IReportHandlerFacade
    {
        IXmlReportArchiveProvider GetArchiveProvider(String elementName);

        IReport GetReport(Int32 id);

        IReport AddReport(IReport report);

        void UpdateReport(IReport report);

        void RemoveReport(IReport report);

        ReportCollection GetReports(IReportCase reportCase, Int32 page, Int32 pageSize, out Int32 totalItems, ReportSortOrder[] sortOrder);

        IReportCase GetReportCase(Int32 id);

        void UpdateReportCase(IReportCase reportCase);

        void RemoveReportCase(IReportCase reportCase);

        ReportCaseCollection GetReportCases(SiteCollection sites, Int32 page, Int32 pageSize, out Int32 totalItems,
                                            ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(SiteCollection sites, NullValueAction siteNullAction, Int32 page, Int32 pageSize,
                                            out Int32 totalItems, ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(ReportCaseStatus status, SiteCollection sites, Int32 page, Int32 pageSize, out Int32 totalItems,
                                            ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(ReportCaseStatus status, SiteCollection sites, NullValueAction siteNullAction, Int32 page,
                                            Int32 pageSize, out Int32 totalItems, ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(IReportableEntity entity, SiteCollection sites, Int32 page, Int32 pageSize, out Int32 totalItems,
                                            ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(IReportableEntity entity, SiteCollection sites, NullValueAction siteNullAction, Int32 page,
                                            Int32 pageSize, out Int32 totalItems, ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(ReportCaseStatus status, IReportableEntity entity, SiteCollection sites, Int32 page,
                                            Int32 pageSize, out Int32 totalItems, ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(ReportCaseStatus status, IReportableEntity entity, SiteCollection sites,
                                            NullValueAction siteNullAction, Int32 page, Int32 pageSize, out Int32 totalItems,
                                            ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(ReportCaseStatus status, Type type, SiteCollection sites, Int32 page, Int32 pageSize,
                                            out Int32 totalItems, ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(ReportCaseStatus status, Type type, SiteCollection sites, NullValueAction siteNullAction,
                                            Int32 page, Int32 pageSize, out Int32 totalItems, ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(Type type, SiteCollection sites, Int32 page, Int32 pageSize, out Int32 totalItems,
                                            ReportCaseSortOrder[] sortOrder);

        ReportCaseCollection GetReportCases(Type type, SiteCollection sites, NullValueAction siteNullAction, Int32 page, Int32 pageSize,
                                            out Int32 totalItems, ReportCaseSortOrder[] sortOrder);

        UserReportStatsCollection GetReportedAuthors(SiteCollection sites, NullValueAction siteNullAction, Int32 page, Int32 pageSize,
                                                     out Int32 totalItems, UserReportStatsSortOrder[] sortOrder);

        UserReportStatsCollection GetReportingUsers(SiteCollection sites, NullValueAction siteNullAction, Int32 page, Int32 pageSize,
                                                    out Int32 totalItems, UserReportStatsSortOrder[] sortOrder);

        IUserReportStats GetUserReportStats(IUser user, UserReportStatsPerspective perspective, SiteCollection sites,
                                            NullValueAction siteNullAction);

        Boolean IsReported(IReportableEntity entity);

        event EPiServerCommonEventHandler ReportAdded;

        event EPiServerCommonEventHandler ReportUpdated;

        event EPiServerCommonEventHandler ReportRemoved;

        event EPiServerCommonEventHandler ReportCaseUpdated;

        event EPiServerCommonEventHandler ReportCaseRemoved;
    }
}